package com.xbao.dao;

import com.xbao.model.Emp;
import com.xbao.model.EmpExample;
import java.util.List;

import org.apache.ibatis.annotations.*;
import org.apache.ibatis.type.JdbcType;
@Mapper
public interface EmpMapper {
    @SelectProvider(type=EmpSqlProvider.class, method="countByExample")
    int countByExample(EmpExample example);

    @DeleteProvider(type=EmpSqlProvider.class, method="deleteByExample")
    int deleteByExample(EmpExample example);

    @Delete({
        "delete from emp",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    @Insert({
        "insert into emp (name, tel, ",
        "mobile, emptype, ",
        "headurl, orgid, createtime, ",
        "updatetime, wopenid, ",
        "isdel, wskey, wunionid, ",
        "pwd)",
        "values (#{name,jdbcType=VARCHAR}, #{tel,jdbcType=VARCHAR}, ",
        "#{mobile,jdbcType=VARCHAR}, #{emptype,jdbcType=INTEGER}, ",
        "#{headurl,jdbcType=VARCHAR}, #{orgid,jdbcType=BIGINT}, #{createtime,jdbcType=BIGINT}, ",
        "#{updatetime,jdbcType=BIGINT}, #{wopenid,jdbcType=VARCHAR}, ",
        "#{isdel,jdbcType=INTEGER}, #{wskey,jdbcType=VARCHAR}, #{wunionid,jdbcType=VARCHAR}, ",
        "#{pwd,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insert(Emp record);

    @InsertProvider(type=EmpSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insertSelective(Emp record);

    @SelectProvider(type=EmpSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="tel", property="tel", jdbcType=JdbcType.VARCHAR),
        @Result(column="mobile", property="mobile", jdbcType=JdbcType.VARCHAR),
        @Result(column="emptype", property="emptype", jdbcType=JdbcType.INTEGER),
        @Result(column="headurl", property="headurl", jdbcType=JdbcType.VARCHAR),
        @Result(column="orgid", property="orgid", jdbcType=JdbcType.BIGINT),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.BIGINT),
        @Result(column="updatetime", property="updatetime", jdbcType=JdbcType.BIGINT),
        @Result(column="wopenid", property="wopenid", jdbcType=JdbcType.VARCHAR),
        @Result(column="isdel", property="isdel", jdbcType=JdbcType.INTEGER),
        @Result(column="wskey", property="wskey", jdbcType=JdbcType.VARCHAR),
        @Result(column="wunionid", property="wunionid", jdbcType=JdbcType.VARCHAR),
        @Result(column="pwd", property="pwd", jdbcType=JdbcType.VARCHAR)
    })
    List<Emp> selectByExample(EmpExample example);

    @Select({
        "select",
        "id, name, tel, mobile, emptype, headurl, orgid, createtime, updatetime, wopenid, ",
        "isdel, wskey, wunionid, pwd",
        "from emp",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="name", property="name", jdbcType=JdbcType.VARCHAR),
        @Result(column="tel", property="tel", jdbcType=JdbcType.VARCHAR),
        @Result(column="mobile", property="mobile", jdbcType=JdbcType.VARCHAR),
        @Result(column="emptype", property="emptype", jdbcType=JdbcType.INTEGER),
        @Result(column="headurl", property="headurl", jdbcType=JdbcType.VARCHAR),
        @Result(column="orgid", property="orgid", jdbcType=JdbcType.BIGINT),
        @Result(column="createtime", property="createtime", jdbcType=JdbcType.BIGINT),
        @Result(column="updatetime", property="updatetime", jdbcType=JdbcType.BIGINT),
        @Result(column="wopenid", property="wopenid", jdbcType=JdbcType.VARCHAR),
        @Result(column="isdel", property="isdel", jdbcType=JdbcType.INTEGER),
        @Result(column="wskey", property="wskey", jdbcType=JdbcType.VARCHAR),
        @Result(column="wunionid", property="wunionid", jdbcType=JdbcType.VARCHAR),
        @Result(column="pwd", property="pwd", jdbcType=JdbcType.VARCHAR)
    })
    Emp selectByPrimaryKey(Long id);

    @UpdateProvider(type=EmpSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Emp record, @Param("example") EmpExample example);

    @UpdateProvider(type=EmpSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Emp record, @Param("example") EmpExample example);

    @UpdateProvider(type=EmpSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Emp record);

    @Update({
        "update emp",
        "set name = #{name,jdbcType=VARCHAR},",
          "tel = #{tel,jdbcType=VARCHAR},",
          "mobile = #{mobile,jdbcType=VARCHAR},",
          "emptype = #{emptype,jdbcType=INTEGER},",
          "headurl = #{headurl,jdbcType=VARCHAR},",
          "orgid = #{orgid,jdbcType=BIGINT},",
          "createtime = #{createtime,jdbcType=BIGINT},",
          "updatetime = #{updatetime,jdbcType=BIGINT},",
          "wopenid = #{wopenid,jdbcType=VARCHAR},",
          "isdel = #{isdel,jdbcType=INTEGER},",
          "wskey = #{wskey,jdbcType=VARCHAR},",
          "wunionid = #{wunionid,jdbcType=VARCHAR},",
          "pwd = #{pwd,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(Emp record);
}